#include "ObliqueUtil.h"

using namespace OCPP;
using namespace OCPP::Cesium;

void ObliqueUtil::writePreview(StringVector& tiles, String dataPath)
{
	osg::ref_ptr<osg::Group> group = new osg::Group();

	for (auto i = 0; i < tiles.size(); i++)
	{
		String fileName = joinPath(dataPath, tiles[i], tiles[i] + ".osgb");
		osg::ref_ptr<osg::ProxyNode> node = new osg::ProxyNode();
		node->setFileName(0, fileName);
		//node->setCenterMode(osg::ProxyNode::USER_DEFINED_CENTER);
		//node->setRadius(Math::POS_INFINITY);
		group->addChild(node);
	}

	osgDB::writeNodeFile(*group, joinPath(dataPath,"../preview.osg"));
}
